package cn.jizi.bshisy.controller;

import cn.jizi.bshisy.entity.Processing;
import cn.jizi.bshisy.service.ProcessingService;
import cn.jizi.bshisy.tool.ShuiJi;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/process")
public class ProcessingContriller {

    @Resource
    private ProcessingService processingService;

    /*添加一条处理方案信息*/
    @ApiOperation(value = "添加一条处理方案信息", notes = "添加一条处理方案信息")
    @PostMapping(value = "/getAddProcessing")
    public String getAddPayItems(Processing processing) {
        processing.setPid(ShuiJi.random());
        int count = processingService.getAddProcessing(processing);
        if (count > 0) {

            return "添加成功";
        } else {
            return "添加失败";
        }
    }
}
